package com.doubi.controller.api;

import com.doubi.common.aspectj.annotation.Delay;
import com.doubi.controller.common.BaseController;
import com.doubi.service.FeedbackService;
import com.doubi.vo.AppUiModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@CrossOrigin
@RequestMapping("Api/Feedback")
@Api(value = "意见反馈", tags = "意见反馈")
public class ApiFeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;

    @ApiOperation(value = "意见反馈")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "string"),
            @ApiImplicitParam(name = "imgUrls", value = "图片", dataType = "string"),
            @ApiImplicitParam(name = "contact", value = "联系方式", required = true, dataType = "string"),
    })
    @GetMapping("Feedback")
    @ResponseBody
    public AppUiModel<String> feedback(String content, String imgUrls, String contact) {
        return feedbackService.saveFeedback(content, imgUrls, contact, super.getUserOid());
    }
}
